home *** CD-ROM | disk | FTP | other *** search
- /* 00010000
- * Name: GOPCLIUI REXX 00020000
- * VM TCP/IP Network GOPHER Client user input 00030000
- * Author: Rick Troth, Rice University, Information Systems 00040000
- * Date: 1992-Dec-23 00050000
- * 00060000
- * Input: a prompt string 00070000
- * Output: the user's response 00080000
- * 00090000
- * Untested with multiples, but should work that way. 00100000
- */ 00110000
- 00120000
- /* 00130000
- * Copyright 1992 Richard M. Troth. This software was developed 00140000
- * with resources provided by Rice University and is intended 00150000
- * to serve Rice's user community. Rice has benefitted greatly 00160000
- * from the free distribution of software, therefore distribution 00170000
- * of unmodified copies of this material is not restricted. 00180000
- * You may change your own copy as needed. Neither Rice 00190000
- * University nor any of its employees or students shall be held 00200000
- * liable for damages resulting from the use of this software. 00210000
- */ 00220000
- 00230000
- Trace "OFF" 00240000
- 00250000
- /* fetch fs. stem variable from calling REXX environment */ 00260000
- 'CALLPIPE REXXVARS 1 | DROP | JOIN 1 /,/' , 00270000
- '| CHANGE /n /,/ | CHANGE /,v /,/ 1 | LOCATE /FS./ | VARLOAD' 00280000
- 00290000
- /* trouble with plain write, so fetch current screen contents */ 00300000
- 'CALLPIPE LITERAL 00 | SPEC 1-2 X2C 1' , 00310000
- '| FULLSCR' fs.tube 'CONDREAD | VAR SCREEN' 00320000
- Parse Var screen 1 aid 2 cursor 4 screen 00330000
- 00340000
- Do Forever 00350000
- 00360000
- 'PEEKTO PROMPT' 00370000
- If rc ^= 0 Then Leave 00380000
- 00390000
- Parse Var prompt prompt ';' preset 00400000
- prompt = Strip(prompt) 00410000
- preset = Strip(preset) 00420000
- 00430000
- /* --------------------------------------------------------- GPROMPT00440000
- * Present a prompt and read from the Gopher user's screen. 00450000
- * Preset response data may have been supplied. 00460000
- */ 00470000
- 00480000
- prompt = fs.write || 'C3'x || screen || , 00490000
- sba(1,-1) || field("PROT","GREEN") || prompt , 00500000
- || field("HIGH","WHITE") || '13'x || preset || , 00510000
- Copies('00'x,fs.scrcols*2-Length(prompt)-Length(preset)-4) ,00520000
- || field("PROT") 00530000
- 00540000
- 'CALLPIPE VAR PROMPT | FULLSCR' fs.tube '| VAR RS' 00550000
- Parse Var rs With 1 aid 2 . 4 rs 00560000
- 00570000
- If aid = '7D'x /* enter */ Then Do 00580000
- Parse Var rs With . '11'x rs 00590000
- rs = Substr(rs,3) 00600000
- If rs = "" Then rs = preset 00610000
- 'OUTPUT' rs 00620000
- End /* If .. Do */ 00630000
- 00640000
- Else 'OUTPUT' 00650000
- 00660000
- 'CALLPIPE VAR CURSOR | SPEC /00C311/ X2C 1 1.2 NEXT' , 00670000
- '/13/ X2C NEXT | FULLSCR' fs.tube 'NOREAD | HOLE' 00680000
- 00690000
- 'READTO' 00700000
- 00710000
- End /* Do Forever */ 00720000
- 00730000
- Exit rc * (rc ^= 12) 00740000
- 00750000
- 00760000
- 00770000
- 00780000
- /* ----------------------------------------------------------------- SBA00790000
- * (a better SBA function extracted from PIPEDEMO; thanks, Chuck!) 00800000
- * Construct Set Buffer Address order from row and column. 00810000
- */ 00820000
- 00830000
- SBA: Procedure Expose fs. 00840000
- 00850000
- arg row , col, . 00860000
- row = Trunc(row) 00870000
- col = Trunc(col) 00880000
- 00890000
- /*-----------------------------------------------------------------*/ 00900000
- /* Calculate binary address. */ 00910000
- /*-----------------------------------------------------------------*/ 00920000
- 00930000
- offset = row * fs.scrcols + col 00940000
- Do While offset < 0; offset = offset + fs.scrrows * fs.scrcols; End 00950000
- 00960000
- if fs.14bit then return '11'x || d2c(offset,2) 00970000
- 00980000
- /*-----------------------------------------------------------------*/ 00990000
- /* Convert to six-bit format. (xxxx111111111111 -> 0011111100111111*/ 01000000
- /*-----------------------------------------------------------------*/ 01010000
- 01020000
- 'CALLPIPE var offset' , /* Start with char number. */01030000
- '| spec 1-* d2c 1.2 right' , /* Convert to binary. */01040000
- '| spec 1-* c2b 1' , /* Convert to bit string. */01050000
- '| spec /00/ 1 5.6 3' , /* Place first six bits. */01060000
- '/00/ 9 11.6 11' , /* Place second six bits. */01070000
- '| spec 1-* b2c 1' , /* Convert back to binary. */01080000
- '| xlate *-* 00-3F 40-7F' , /* Translate to coded */01090000
- '01-09 C1-C9' , /* buffer address. */01100000
- '11-19 D1-D9' , /* */01110000
- '22-29 E2-E9' , /* */01120000
- '30-39 F0-F9' , /* */01130000
- '| spec x11 1 1.2 2' , /* Prefix with SBA order. */01140000
- '| var offset' /* Put back in variable. */01150000
- 01160000
- Return offset 01170000
- 01180000
- 01190000
- 01200000
- /* --------------------------------------------------------------- FIELD01210000
- * Generate the 3270 DS sequence for extended field attributes 01220000
- * (if available). 01230000
- */ 01240000
- FIELD: Procedure Expose fs. 01250000
- a = '00'x 01260000
- b = '00'x 01270000
- c = 'F1'x 01280000
- i = 1 01290000
- Do While Arg(i) ^= "" 01300000
- Select /* at */ 01310000
- When Abbrev("PROTECTED",Arg(i),2) Then a = bitor(a,'20'x) 01320000
- When Abbrev("SKIP",Arg(i),1) Then a = bitor(a,'10'x) 01330000
- When Abbrev("NODISPLAY",Arg(i),1) Then a = bitor(a,'0C'x) 01340000
- When Abbrev("HIGH",Arg(i),1) Then a = bitor(a,'08'x) 01350000
- When Abbrev("BLINK",Arg(i),3) Then b = bitor(b,'01'x) 01360000
- When Abbrev("REVERSE",Arg(i),3) Then b = bitor(b,'02'x) 01370000
- When Abbrev("UNDERLINE",Arg(i),1) Then b = bitor(b,'04'x) 01380000
- When Abbrev("BLUE",Arg(i),3) Then c = 'F1'x 01390000
- When Abbrev("RED",Arg(i),3) Then c = 'F2'x 01400000
- When Abbrev("PINK",Arg(i),1) Then c = 'F3'x 01410000
- When Abbrev("GREEN",Arg(i),1) Then c = 'F4'x 01420000
- When Abbrev("TURQUOISE",Arg(i),1) Then c = 'F5'x 01430000
- When Abbrev("YELLOW",Arg(i),1) Then c = 'F6'x 01440000
- When Abbrev("WHITE",Arg(i),1) Then c = 'F7'x 01450000
- Otherwise nop 01460000
- End /* Select at */ 01470000
- i = i + 1 01480000
- End /* Do While */ 01490000
- 01500000
- If ^fs.color | , 01510000
- ^fs.exthi Then Return '1D'x || bitor(a,'40'x) 01520000
- Else Return '2902'x || , 01530000
- 'C0'x || bitor(a,'40'x) || , 01540000
- '42'x || bitor(c,'40'x) 01550000
- 01560000
-